package org.cmd.args;

/**
 * 
 * 指令描述
 *
 */
public class Command {

	private String name;
	private String describe;
	private boolean hasPara;
	private boolean required;
	
	public Command(String name, String describe){
		this(name, describe, false);
	}
	
	public Command(String name, String describe, boolean hasPara){
		this(name, describe, hasPara, false);
	}
	
	public Command(String name, String describe, boolean hasPara, boolean required){
		this.name = name.toLowerCase();
		this.describe = describe;
		this.hasPara = hasPara;
		this.required = required;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescribe() {
		return (required ? "必须    " : "可选    ") + describe;
	}

	public void setDescribe(String describe) {
		this.describe = describe;
	}

	public boolean hasPara() {
		return hasPara;
	}

	public void setHasPara(boolean hasPara) {
		this.hasPara = hasPara;
	}

	public boolean isRequired() {
		return required;
	}

	public void setRequired(boolean required) {
		this.required = required;
	}
	
}
